using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TransparentSplashControl;

namespace WindowsApplication1
{

    public partial class Form1 : Form
    {
        public Form1()
        {
            //n.b. TransparentSplash.BeginDisplay was called in Program.cs Main
            InitializeComponent();
        }
        
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            //this is where to call TransparentSplash.EndDisplay
            
            TransparentSplash.EndDisplay();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            TransparentSplash.Instance.CommentaryString = "Move something below me!";

            //simulate delay during onload
            System.Threading.Thread.Sleep(4000);
            
        }

        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            TransparentSplash.BeginDisplay();
            base.OnFormClosing(e);
        }

        protected override void OnFormClosed(FormClosedEventArgs e)
        {
            TransparentSplash.EndDisplay();
            TransparentSplash.Instance.Dispose();
            base.OnFormClosed(e);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
            TransparentSplash.BeginDisplay();
            
        }

        private void button2_Click(object sender, EventArgs e)
        {
            TransparentSplash.EndDisplay();
        }
    }
}